# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: mio <miyopan@e.email>
pkgname=timg
pkgver=1.6.0
pkgrel=0
pkgdesc="24-Bit color image viewer for terminal"
url="https://github.com/hzeller/timg"
arch="all"
options="!check" # package doesn't have test
license="GPL-2.0-only"
makedepends="
	cmake
	ffmpeg-dev
	freetype-dev
	graphicsmagick-dev
	libdeflate-dev
	libexif-dev
	libjpeg-turbo-dev
	librsvg-dev
	libsixel-dev
	libwebp-dev
	poppler-dev
	samurai
	xz-dev
	zlib-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hzeller/timg/archive/v$pkgver.tar.gz
	missing-include.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DTIMG_VERSION_FROM_GIT=OFF \
		-DDISTRIBUTION_VERSION="$pkgver"
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -Dm0644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

sha512sums="
6b1f68f9dc38f1b9f1738a9e85f14b86576b241fa6f8a204018e293a286a7f9c7c1f2425afbe2c9b7f682f1cd35eed0e53f9df3bccc4e4ba9d41fc36d00dabc6  timg-1.6.0.tar.gz
ebb3cba19abc2fce580c6d6a5d991f0ce09ab34795fc41662938c5e34a1c72939bed9642a13657d445205762d42f01efa7adfb11f6732104a069d9f681262cf6  missing-include.patch
"
